package com.softserveinc.autorent.controller;

import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

import java.util.Collection;
import java.util.List;

import com.softserveinc.autorent.model.Car;
import com.softserveinc.autorent.model.CarVendor;

@Stateless
@LocalBean
public class CarVendorController //Он же фасад
{
	@EJB
	private CarVendorManager carVendorManager;
	
	
	public void create(CarVendor c)
	{
		carVendorManager.create(c);
	}
	
	public CarVendor read(int id)
	{
		
		return carVendorManager.read(id);
	}
	
	public void update(CarVendor c)
	{
		carVendorManager.update(c);
	}
	
	public void delete(int id)
	{
		carVendorManager.delete(id);
	}
	
	public void delete(CarVendor c)
	{
		carVendorManager.delete(c);
	}
	
	public List<CarVendor> getAll()
	{
		Collection<CarVendor> c = carVendorManager.getAll();
		
		return (List<CarVendor>)c;
	}
	    
}
